package com.runda.partypolicy.app.repository.live;


import com.runda.partypolicy.app.repository.RepositoryException;

import androidx.annotation.NonNull;

/**
 * author:  RD_CY
 * date:    2017/5/2
 * version: v1.0
 * description:数据Wrapper
 */
public class LiveDataWrapper<T> {

    private boolean success;

    private T data;

    private RepositoryException error;


    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public RepositoryException getError() {
        return error;
    }

    public void setError(RepositoryException error) {
        this.error = error;
    }

    public LiveDataWrapper() {
    }

    public LiveDataWrapper(boolean success, @NonNull T data) {
        this.success = success;
        this.data = data;
    }

    public LiveDataWrapper(boolean success, @NonNull RepositoryException error) {
        this.success = success;
        this.error = error;
    }
}
